using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Diagnostics.CodeAnalysis;
using PetaPoco;

namespace BlazorAdmin.Models
{
	[PrimaryKey("id")]
	[TableName($"{nameof(EmailTask)}s")]
	public class EmailTask
	{
        /// <summary>
        /// 主键
        /// </summary>
		[NotNull]
		[DisplayName("主键")]
		public int Id { get; set; }

        /// <summary>
        /// 获取或设置  Allow Null
        /// </summary>
        [AllowNull]
        [DisplayName("")]
        [MaxLength(100, ErrorMessage = "{0}不能超过 100 个字符")]
        public string Subject { get; set; }

        /// <summary>
        /// 获取或设置  Allow Null
        /// </summary>
		[AllowNull]
		[DisplayName("")]
		[MaxLength(400, ErrorMessage = "{0}不能超过 400 个字符")]
		public string BlindCarbonCopy { get; set; }

        /// <summary>
        /// 获取或设置  Allow Null
        /// </summary>
		[AllowNull]
		[DisplayName("")]
		[MaxLength(400, ErrorMessage = "{0}不能超过 400 个字符")]
		public string CarbonCopy { get; set; }

        /// <summary>
        /// 获取或设置  Allow Null
        /// </summary>
		[AllowNull]
		[DisplayName("")]
		public DateTime? DeliveryTime { get; set; }

        /// <summary>
        /// 获取或设置  Not Null
        /// </summary>
		[NotNull]
		[DisplayName("")]
		[Required(ErrorMessage = "{0}不可为空")]
		public int ErrorTimes { get; set; }

        /// <summary>
        /// 获取或设置  Allow Null
        /// </summary>
		[AllowNull]
		[DisplayName("")]
		public string HtmlContent { get; set; }

        /// <summary>
        /// 获取或设置  Not Null
        /// </summary>
		[NotNull]
		[DisplayName("")]
		[Required(ErrorMessage = "{0}不可为空")]
		public bool IsDelivery { get; set; }

        /// <summary>
        /// 获取或设置  Allow Null
        /// </summary>
		[AllowNull]
		[DisplayName("")]
		[MaxLength(200, ErrorMessage = "{0}不能超过 200 个字符")]
		public string Message { get; set; }

        /// <summary>
        /// 获取或设置  Not Null
        /// </summary>
		[NotNull]
		[DisplayName("")]
		[Required(ErrorMessage = "{0}不可为空")]
		[MaxLength(400, ErrorMessage = "{0}不能超过 400 个字符")]
		public string Recipient { get; set; }

        /// <summary>
        /// 获取或设置  Not Null
        /// </summary>
		[NotNull]
		[DisplayName("")]
		[Required(ErrorMessage = "{0}不可为空")]
		[MaxLength(20, ErrorMessage = "{0}不能超过 20 个字符")]
		public string Sender { get; set; }

		#region 添加的成员

		[Ignore]
        public bool IsSendSQE { get; set; }

        #endregion
    }
}
